package com.example.springretrydemo.test;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.stereotype.Component;
import org.springframework.util.ReflectionUtils;

import javax.jws.soap.SOAPBinding;
import java.lang.annotation.Annotation;

@Component
public class MyBeanPostProcessor  implements BeanPostProcessor {

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        if (bean != null && bean instanceof UserFacade) {
            System.out.println("开始执行");
            Object proxyInstance = SpringRetryProxy.newProxyInstance(bean);
            if (proxyInstance != null) {
                return proxyInstance;
            }
        }
        return bean;
    }
}
